using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DomainLayer.Data.Entities;

namespace Infrastructure.Data.Mapping
{
	public class UnusualWaybillMap : EntityTypeConfiguration<UnusualWaybill>
	{
		public UnusualWaybillMap()
		{
			// Primary Key
			this.HasKey(t => t.UnusualWaybillID);

			// Properties
			this.Property(t => t.CustomerOrder)
				.HasMaxLength(20);
				
			this.Property(t => t.Reason)
				.HasMaxLength(20);
				
			this.Property(t => t.Comment)
				.HasMaxLength(200);
				
			// Table & Column Mappings
			this.ToTable("UnusualWaybill");
			this.Property(t => t.UnusualWaybillID).HasColumnName("UnusualWaybillID");
			this.Property(t => t.WaybillNO).HasColumnName("WaybillNO");
			this.Property(t => t.CustomerOrder).HasColumnName("CustomerOrder");
			this.Property(t => t.DeliverStationID).HasColumnName("DeliverStationID");
			this.Property(t => t.Status).HasColumnName("Status");
			this.Property(t => t.Reason).HasColumnName("Reason");
			this.Property(t => t.Comment).HasColumnName("Comment");
			this.Property(t => t.CreatBy).HasColumnName("CreatBy");
			this.Property(t => t.CreatStation).HasColumnName("CreatStation");
			this.Property(t => t.CreatTime).HasColumnName("CreatTime");
			this.Property(t => t.UpdateBy).HasColumnName("UpdateBy");
			this.Property(t => t.UpdateStation).HasColumnName("UpdateStation");
			this.Property(t => t.UpdateTime).HasColumnName("UpdateTime");
			this.Property(t => t.IsDelete).HasColumnName("IsDelete");
		}
	}
}

